package qf.index;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;

import java.sql.SQLException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PmUnit {

    /**
     * PubMed提取作者及单位信息，在程序分两种，一种是仍按PubMed原始的格式，且校对作者的姓和名的次序（方法：getPmAuthList），另一种是转换成WOS的格式，以后统一按WOS的来处理（方法：getPmC1List）。
     * 贾新志 2025.01.18
     */

    public static void main(String[] args) throws SQLException {

        Map<String, String> standardAndKeyWordMap = new HashMap<>();
        En.UnivHosp univHosp = getUnivHosp();
        Set<String> pinYinSet = getPinYinSet();

        // 测试
//        String authorExtend = "[{\"collectiveName\":\"\",\"ForeName\":\"A\",\"IdentifierSource\":\"\",\"Initials\":\"A\",\"Suffix\":\"\",\"LastName\":\"Manios\",\"Affiliation\":[\"Department of Surgical Oncology, University of Heraklion, Crete, Greece.\"]},{\"collectiveName\":\"\",\"ForeName\":\"J\",\"IdentifierSource\":\"\",\"Initials\":\"J\",\"Suffix\":\"\",\"LastName\":\"Katsantonis\",\"Affiliation\":[]},{\"collectiveName\":\"\",\"ForeName\":\"A\",\"IdentifierSource\":\"\",\"Initials\":\"A\",\"Suffix\":\"\",\"LastName\":\"Tosca\",\"Affiliation\":[]},{\"collectiveName\":\"\",\"ForeName\":\"C H\",\"IdentifierSource\":\"\",\"Initials\":\"CH\",\"Suffix\":\"\",\"LastName\":\"Skulakis\",\"Affiliation\":[]},{\"collectiveName\":\"\",\"ForeName\":\"D\",\"IdentifierSource\":\"\",\"Initials\":\"D\",\"Suffix\":\"\",\"LastName\":\"Tsiftsis\",\"Affiliation\":[]}]";
//        getPmAuthList( authorExtend,  pinYinSet,  standardAndKeyWordMap,  univHosp);

        // 29361890 多个作者，有同一个单位   35324799  35451330  38774450
//        String authorExtend = "[{\"collectiveName\":\"\",\"ForeName\":\"Yuanwei\",\"IdentifierSource\":\"\",\"Initials\":\"Y\",\"Suffix\":\"\",\"LastName\":\"Yan\",\"Affiliation\":[\"1 Department of Chemical and Biomedical Engineering, FAMU-FSU College of Engineering, Florida State University , Tallahassee, Florida.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Liqing\",\"IdentifierSource\":\"\",\"Initials\":\"L\",\"Suffix\":\"\",\"LastName\":\"Song\",\"Affiliation\":[\"1 Department of Chemical and Biomedical Engineering, FAMU-FSU College of Engineering, Florida State University , Tallahassee, Florida.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Julie\",\"IdentifierSource\":\"\",\"Initials\":\"J\",\"Suffix\":\"\",\"LastName\":\"Bejoy\",\"Affiliation\":[\"1 Department of Chemical and Biomedical Engineering, FAMU-FSU College of Engineering, Florida State University , Tallahassee, Florida.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Jing\",\"IdentifierSource\":\"\",\"Initials\":\"J\",\"Suffix\":\"\",\"LastName\":\"Zhao\",\"Affiliation\":[\"2 Department of Neuroscience, Alzheimer's Disease Research Center , Mayo Clinic, Jacksonville, Florida.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Takahisa\",\"IdentifierSource\":\"\",\"Initials\":\"T\",\"Suffix\":\"\",\"LastName\":\"Kanekiyo\",\"Affiliation\":[\"2 Department of Neuroscience, Alzheimer's Disease Research Center , Mayo Clinic, Jacksonville, Florida.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Guojun\",\"IdentifierSource\":\"\",\"Initials\":\"G\",\"Suffix\":\"\",\"LastName\":\"Bu\",\"Affiliation\":[\"2 Department of Neuroscience, Alzheimer's Disease Research Center , Mayo Clinic, Jacksonville, Florida.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Yi\",\"IdentifierSource\":\"\",\"Initials\":\"Y\",\"Suffix\":\"\",\"LastName\":\"Zhou\",\"Affiliation\":[\"3 Department of Biomedical Sciences, College of Medicine, Florida State University , Tallahassee, Florida.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Yan\",\"IdentifierSource\":\"\",\"Initials\":\"Y\",\"Suffix\":\"\",\"LastName\":\"Li\",\"Affiliation\":[\"1 Department of Chemical and Biomedical Engineering, FAMU-FSU College of Engineering, Florida State University , Tallahassee, Florida.\"]}]";
        // [Yan, Yuanwei; Song, Liqing; Bejoy, Julie; Li, Yan] Florida State Univ, FAMU FSU Coll Engn, Dept Chem & Biomed Engn, 2525 Pottsdamer St, Tallahassee, FL 32310 USA;
        // [Zhao, Jing; Kanekiyo, Takahisa; Bu, Guojun] Mayo Clin, Dept Neurosci, Alzheimers Dis Res Ctr, Jacksonville, FL 32224 USA;
        // [Zhou, Yi] Florida State Univ, Coll Med, Dept Biomed Sci, Tallahassee, FL 32306 USA;
        // [Yan, Yuanwei] Univ Wisconsin, Waisman Ctr, Madison, WI 53705 USA

        // 35060652 同一个作者，有三个单位  36338176  38774450
//        String authorExtend ="[{\"collectiveName\":\"\",\"ForeName\":\"Luiz E\",\"IdentifierSource\":\"0000-0003-2732-8164\",\"Initials\":\"LE\",\"Suffix\":\"\",\"LastName\":\"Bertassoni\",\"Affiliation\":[\"Division of Biomaterials and Biomechanics, School of Dentistry, Oregon Health and Science University, Portland, OR, 97201, USA.\",\"Department of Biomedical Engineering, School of Medicine, Oregon Health and Science University, Portland, OR, 97239, USA.\",\"Center for Regenerative Medicine, Oregon Health and Science University, Portland, OR, 97239, USA.\",\"Cancer Early Detection Advanced Research (CEDAR), Knight Cancer Institute, Oregon Health and Science University, Portland, OR, 97239, USA.\"]}]";
        // [Bertassoni, Luiz E.] Oregon Hlth & Sci Univ, Sch Dent, Div Biomat & Biomech, Portland, OR 97201 USA;
        // [Bertassoni, Luiz E.] Oregon Hlth & Sci Univ, Sch Med, Dept Biomed Engn, Portland, OR 97239 USA;
        // [Bertassoni, Luiz E.] Oregon Hlth & Sci Univ, Ctr Regenerat Med, Portland, OR 97239 USA;
        // [Bertassoni, Luiz E.] Oregon Hlth & Sci Univ, Knight Canc Inst, Canc Early Detect Adv Res CEDAR, Portland, OR 97239 USA

        // 38774450
        String authorExtend = "[{\"collectiveName\":\"\",\"ForeName\":\"Hui\",\"IdentifierSource\":\"\",\"Initials\":\"H\",\"Suffix\":\"\",\"LastName\":\"Wang\",\"Affiliation\":[\"Master Lab for Innovative Application of Nature Products, National Center of Technology Innovation for Synthetic Biology, Tianjin Institute of Industrial Biotechnology, Chinese Academy of Sciences (CAS), Tianjin, 300308, China.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Xiangyang\",\"IdentifierSource\":\"\",\"Initials\":\"X\",\"Suffix\":\"\",\"LastName\":\"Li\",\"Affiliation\":[\"Henan Engineering Research Center of Food Microbiology, College of Food and Bioengineering, Henan University of Science and Technology, Luoyang, 471023, China.\",\"Haihe Laboratory of Synthetic Biology, Tianjin, 300308, China.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Pengcheng\",\"IdentifierSource\":\"\",\"Initials\":\"P\",\"Suffix\":\"\",\"LastName\":\"Shi\",\"Affiliation\":[\"Henan Engineering Research Center of Food Microbiology, College of Food and Bioengineering, Henan University of Science and Technology, Luoyang, 471023, China.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Xiaoyan\",\"IdentifierSource\":\"\",\"Initials\":\"X\",\"Suffix\":\"\",\"LastName\":\"You\",\"Affiliation\":[\"Master Lab for Innovative Application of Nature Products, National Center of Technology Innovation for Synthetic Biology, Tianjin Institute of Industrial Biotechnology, Chinese Academy of Sciences (CAS), Tianjin, 300308, China.\",\"Henan Engineering Research Center of Food Microbiology, College of Food and Bioengineering, Henan University of Science and Technology, Luoyang, 471023, China.\"]},{\"collectiveName\":\"\",\"ForeName\":\"Guoping\",\"IdentifierSource\":\"\",\"Initials\":\"G\",\"Suffix\":\"\",\"LastName\":\"Zhao\",\"Affiliation\":[\"Master Lab for Innovative Application of Nature Products, National Center of Technology Innovation for Synthetic Biology, Tianjin Institute of Industrial Biotechnology, Chinese Academy of Sciences (CAS), Tianjin, 300308, China.\",\"CAS-Key Laboratory of Synthetic Biology, CAS Center for Excellence in Molecular Plant Sciences, Shanghai Institute of Plant Physiology and Ecology, Chinese Academy of Sciences, Shanghai, 200032, China.\",\"CAS-Key Laboratory of Quantitative Engineering Biology, Shenzhen Institute of Synthetic Biology, Shenzhen Institute of Advanced Technology, Chinese Academy of Sciences, Shenzhen, 518055, China.\"]}]";
        // [Wang, Hui; You, Xiaoyan; Zhao, Guoping] Chinese Acad Sci, Tianjin Inst Ind Biotechnol, Natl Ctr Technol Innovat Synthet Biol, Master Lab Innovat Applicat Nat Prod, Tianjin 300308, Peoples R China;
        // [Li, Xiangyang; Shi, Pengcheng; You, Xiaoyan] Henan Univ Sci & Technol, Coll Food & Bioengn, Henan Engn Res Ctr Food Microbiol, Luoyang 471023, Peoples R China;
        // [Li, Xiangyang] Haihe Lab Synthet Biol, Tianjin 300308, Peoples R China;
        // [Zhao, Guoping] Chinese Acad Sci, Shanghai Inst Plant Physiol & Ecol, CAS Ctr Excellence Mol Plant Sci, CAS Key Lab Synthet Biol, Shanghai 200032, Peoples R China;
        // [Zhao, Guoping] Chinese Acad Sci, Shenzhen Inst Synthet Biol, Shenzhen Inst Adv Technol, CAS Key Lab Quantitat Engn Biol, Shenzhen 518055, Peoples R China

//        String authorExtend = "[{\"collectiveName\":\"\",\"ForeName\":\"M S\",\"IdentifierSource\":\"\",\"Initials\":\"MS\",\"Suffix\":\"\",\"LastName\":\"Wu\",\"Affiliation\":[\"Department of Medicine, Yale University School of Medicine, New Haven, Connecticut 06520-8029, USA. peter.aronson@yale.edu\"]},{\"collectiveName\":\"\",\"ForeName\":\"D\",\"IdentifierSource\":\"\",\"Initials\":\"D\",\"Suffix\":\"\",\"LastName\":\"Biemesderfer\",\"Affiliation\":[]},{\"collectiveName\":\"\",\"ForeName\":\"G\",\"IdentifierSource\":\"\",\"Initials\":\"G\",\"Suffix\":\"\",\"LastName\":\"Giebisch\",\"Affiliation\":[]},{\"collectiveName\":\"\",\"ForeName\":\"P S\",\"IdentifierSource\":\"\",\"Initials\":\"PS\",\"Suffix\":\"\",\"LastName\":\"Aronson\",\"Affiliation\":[]}]";
        List<En.C1Auth> pmAuthList2 = getPmC1List(authorExtend);
        for (En.C1Auth c1Auth : pmAuthList2) {
            System.out.println(c1Auth);
        }

        String c1 = "Department of Medicine, Yale University School of Medicine, New Haven, Connecticut 06520-8029, USA. [ĺyalE.eduļ], peter.aronson@yale.edu";
        if (c1.contains("[ĺ") && c1.contains("ļ]")) {
            // 提取以"[ĺ"开头，以"ļ]"结尾的字符串。
            String edu = "[@" + c1.replaceAll("(.+?)\\[ĺ(.+?)ļ](.+?$)", "$2") + "]";
            System.out.println("|" + edu + "|");
        }


    }


    public static List<En.C1Auth> getPmC1List(String authorExtend) {
        // PubMed的作者及单位信息保存成与WOS的相一致，PubMed原始的格式是，如果同一个作者有多个单位(38774450)，那么作者是一条，单位是集合，而WOS的格式则是有多条。其二，如果同一单位有多个作者(29361890)，PubMed是多条记录，而WOS会将各作者合并，共同对应一个单位，即只有一条记录。现统一采用WOS的格式返回。
        Map<String, List<String>> infoAndAuthListMap = new LinkedHashMap<>();
        if (null != authorExtend && authorExtend.contains("Affiliation")) {
            JSONArray objects = JSONUtil.parseArray(authorExtend);
            for (Object object : objects) {
                JSON parse = JSONUtil.parse(object);
                String lastName = null != parse.getByPath("LastName") ? parse.getByPath("LastName").toString().trim() : "";
                String foreName = null != parse.getByPath("ForeName") ? parse.getByPath("ForeName").toString().trim() : "";
                String author = "-".equals(foreName) ? lastName.trim() : (lastName + " " + foreName.replace("  ", " ").trim());
                System.out.println(author);
                if (null != parse.getByPath("Affiliation")) {
                    String affiliation = parse.getByPath("Affiliation").toString();
                    System.out.println(affiliation);
                    System.out.println(" ");
                    List<String> infoList = com.alibaba.fastjson.JSON.parseArray(affiliation, String.class);
                    for (String info : infoList) {
                        Utils.putStrListStr(infoAndAuthListMap, info, author);
                    }
                }
            }
        }
        List<En.C1Auth> list = new ArrayList<>();
        for (Map.Entry<String, List<String>> entry : infoAndAuthListMap.entrySet()) {
            En.C1Auth c1Auth = new En.C1Auth();
            c1Auth.setAuthList(entry.getValue());
            String info = Utils.dellEnd(entry.getKey());
            c1Auth.setInfo(modifyEmail(info));
            c1Auth.setSort(list.size() + 1);
            list.add(c1Auth);
        }
        return list;
    }

    public static List<En.SortAuthAndUnit> getPmAuthList(String authorExtend, Set<String> pinYinSet, Map<String, String> standardAndKeyWordMap, En.UnivHosp univHosp) {
        List<En.SortAuthAndUnit> sortAuthAndUnitList = new ArrayList<>();
        if (null != authorExtend && authorExtend.contains("Affiliation")) {
            Set<String> supplementarySet = univHosp.getSupplementarySet();
            Set<String> removeSet = univHosp.getRemoveSet();
            Set<String> univAbbSet = univHosp.getUnivAbbSet();
            Set<String> univNameSet = univHosp.getUnivNameSet();
            Set<String> univFullSet = univHosp.getUnivFullSet();
            Set<String> collFullSet = univHosp.getCollFullSet();
            Set<String> hospNameSet = univHosp.getHospNameSet();
            Set<String> hospFullSet = univHosp.getHospFullSet();
            Set<String> clinicSet = univHosp.getClinicSet();
            Set<String> cancerCenterSet = univHosp.getCancerCenterSet();
            Set<String> medicalCentreSet = univHosp.getMedicalCentreSet();
            Set<String> nationalSet = univHosp.getNationalSet();
            Set<String> suppNatiSet = univHosp.getSuppNatiSet();
            Set<String> instituteSet = univHosp.getInstituteSet();
            Set<String> departmentSet = univHosp.getDepartmentSet();
            Set<String> natiNameSet = univHosp.getNatiNameSet();
            Set<String> collNameSet = univHosp.getCollNameSet();
            Set<String> deptNameSet = univHosp.getDeptNameSet();
            Set<String> instNameSet = univHosp.getInstNameSet();
            JSONArray objects = JSONUtil.parseArray(authorExtend);
            List<String> authorList = new ArrayList<>();
            for (Object object : objects) {
                JSON parse = JSONUtil.parse(object);
                String lastName = null != parse.getByPath("LastName") ? parse.getByPath("LastName").toString().trim() : "";
                String foreName = null != parse.getByPath("ForeName") ? parse.getByPath("ForeName").toString().trim() : "";
                if ("-".equals(foreName)) {
                    authorList.add(lastName);
                } else {
                    authorList.add(lastName + ", " + foreName);
                }
            }
            // Chang-Ming Huang -> isOrder = ture 统一使用：Huang ChangMing
            boolean isOrder = getPiYiOrder(CollUtil.join(authorList, "; "), pinYinSet);
            for (Object object : objects) {
                En.SortAuthAndUnit sortAuthAndUnit = new En.SortAuthAndUnit();
                JSON parse = JSONUtil.parse(object);
                String lastName = null != parse.getByPath("LastName") ? parse.getByPath("LastName").toString().trim() : "";
                String foreName = null != parse.getByPath("ForeName") ? parse.getByPath("ForeName").toString().trim() : "";
                En.OriginalAndStandard auths = new En.OriginalAndStandard();
                if ("-".equals(foreName)) {
                    auths.setOriginal(lastName);
                    String s = changeAuthOrder(lastName, pinYinSet);
                    auths.setStandard(s);
                } else {
                    String auth = lastName + " " + foreName.replace("  ", " ").trim();
                    auths.setOriginal(auth);
                    if (isOrder && auth.lastIndexOf(" ") > 0) {
                        String end = auth.substring(0, auth.lastIndexOf(" "));
                        String start = auth.substring(auth.lastIndexOf(" "));
                        // 部分英文作者的名称，可能有单个字母的，不给予转换。
                        if (end.length() > 1 && start.length() > 1) {
                            auth = start + " " + end;
                        }
                    }
                    String s = changeAuthOrder(auth, pinYinSet);
                    auths.setStandard(s);
                }
                List<En.OriginalAndStandards> units = new ArrayList<>();
                if (null != parse.getByPath("Affiliation")) {
                    String affiliation = parse.getByPath("Affiliation").toString();
                    List<String> unitList = com.alibaba.fastjson.JSON.parseArray(affiliation, String.class);
                    for (String pmC1 : unitList) {
                        Set<String> resultSet = new HashSet<>();
                        En.OriginalAndStandards originalAndStandards = new En.OriginalAndStandards();
                        originalAndStandards.setOriginal(pmC1);
                        pmC1 = pmC1.endsWith(".") ? pmC1.substring(0, pmC1.length() - ".".length()).trim() : pmC1.trim();
                        String c1 = pmC1.replace("＠", "@").contains("@") ? modifyEmail(pmC1.replace("＠", "@")) : pmC1;
                        String[] split = c1.replace(", Inc.", "公司缩写Inc结尾").replace("Co., Ltd.", "公司缩写Co开头").replace(", Ltd.", "公司缩写Ltd结尾").replace(", University, ", " University, ")
                                .replace(", University Hospital, ", ", University Hospital ").replaceAll("^University Hospital, ", "University Hospital ").replaceAll(", University Hospital$", " University Hospital")
                                .replace("；", ", ").replace("， ", ", ").replace("; ", ", ").replaceAll(" +", " ").split(", ");
                        String couny = "";
                        Set<String> suppSet = new HashSet<>();
                        Set<String> remoSet = new HashSet<>();
                        Set<String> univSet = new HashSet<>();
                        Set<String> hospSet = new HashSet<>();
                        Set<String> natiSet = new HashSet<>();
                        Set<String> naSuSet = new HashSet<>();
                        Set<String> deptSet = new HashSet<>();
                        Set<String> collSet = new HashSet<>();
                        Set<String> instSet = new HashSet<>();
                        Set<String> otherSet = new HashSet<>();
                        // bool在这里的作用是，当有任一个可以提取的时，就不要加入其它（otherSet）。但任一个符合某个条件，就添加到某个的里面，这里的数据主要是用于人工的整理，与项目中使用的数据有区别，项目中使用时，有大学使用大学，无再说其它，具体流程下面有注释。
                        boolean bool = true;
                        for (String original : split) {
                            original = original.replace("公司缩写Inc结尾", ", Inc.").replace("公司缩写Co开头", "Co., Ltd.").replace("公司缩写Ltd结尾", ", Ltd.");
                            String s = original.toLowerCase().trim();
                            String o = original.trim();
                            couny = natiNameSet.contains(s) ? s.replace("Electronic address:", "").replace("E-mail:", "").trim() : couny;
                            if (s.length() > 2 && !NumberUtil.isInteger(s.replace("/", "").replace("-", ""))) {
                                if (supplementarySet.contains(s)) {
                                    addSet(s, standardAndKeyWordMap, original, suppSet);
                                    bool = false;
                                }
                                if (removeSet.contains(s)) {
                                    addSet(s, standardAndKeyWordMap, original, remoSet);
                                    bool = false;
                                }
                                if (isContains(s, univNameSet) || isContains(o, univAbbSet) || univFullSet.contains(s) || collFullSet.contains(s)) {
                                    addSet(s, standardAndKeyWordMap, original, univSet);
                                    bool = false;
                                }
                                if (isContains(s, hospNameSet) || hospFullSet.contains(s) || clinicSet.contains(s) || cancerCenterSet.contains(s) || medicalCentreSet.contains(s)) {
                                    addSet(s, standardAndKeyWordMap, original, hospSet);
                                    bool = false;
                                }
                                if (nationalSet.contains(s)) {
                                    addSet(s, standardAndKeyWordMap, original, natiSet);
                                    bool = false;
                                }
                                if (suppNatiSet.contains(s)) {
                                    addSet(s, standardAndKeyWordMap, original, naSuSet);
                                    bool = false;
                                }
                                if (isContains(s, instNameSet) || instituteSet.contains(s)) {
                                    addSet(s, standardAndKeyWordMap, original, instSet);
                                    bool = false;
                                }
                                if (isContains(s, collNameSet)) {
                                    addSet(s, standardAndKeyWordMap, original, collSet);
                                    bool = false;
                                }
                                if (isContains(s, deptNameSet) || departmentSet.contains(s)) {
                                    addSet(s, standardAndKeyWordMap, original, deptSet);
                                    bool = false;
                                }
                                if (c1.contains("[ĺ") && c1.contains("ļ]")) {
                                    // 提取以"[ĺ"开头，以"ļ]"结尾的字符串。
                                    String edu = "[" + c1.replaceAll("(.+?)\\[ĺ(.+?)ļ](.+?$)", "$2").toLowerCase() + "]";
                                    addSet(edu, standardAndKeyWordMap, edu, univSet);
                                    bool = false;
                                }
                                if (bool) {
                                    addSet(s, standardAndKeyWordMap, original, otherSet);
                                }
                            }
                        }
                        couny = couny.endsWith(".") ? couny.substring(0, couny.length() - ".".length()) : couny;
                        if (!naSuSet.isEmpty() && !couny.isEmpty()) {
                            naSuSet.add(couny);
                        }
                        // 当大学不为空的情况下，有医院加医院，无医院不加。
                        if (!univSet.isEmpty()) {
                            resultSet.add(setToStr(univSet));
                            if (!hospSet.isEmpty()) {
                                resultSet.add(setToStr(hospSet));
                            }
                        } else if (!hospSet.isEmpty()) {
                            // 当大学为空，提取的顺序为医院、国家机构、不含名字的国家机构、研究所、原始的C1数据，注意，这里是不能要科室的，因为科室不能算作机构。
                            resultSet.add(setToStr(hospSet));
                        } else if (!natiSet.isEmpty()) {
                            resultSet.add(setToStr(natiSet));
                        } else if (!naSuSet.isEmpty()) {
                            resultSet.add(setToStr(naSuSet));
                        } else if (!instSet.isEmpty()) {
                            resultSet.add(setToStr(instSet));
                        } else {
                            resultSet.add(pmC1);
                        }
                        ArrayList<String> list = new ArrayList<>(resultSet);
                        Collections.sort(list);
                        originalAndStandards.setStandards(list);
                        units.add(originalAndStandards);
                    }
                }
                sortAuthAndUnit.setAuths(auths);
                sortAuthAndUnit.setUnitList(units);
                sortAuthAndUnitList.add(sortAuthAndUnit);
            }
        }
        return sortAuthAndUnitList;
    }


    //  ChangMing Huang  zhuang bing -bo
    public static String changeAuthOrder(String auth, Set<String> pinYinSet) {
        auth = auth.replace(" -", "-").replace("- ", "-").replace(".", " ").replace(",", " ").replaceAll(" +", " ").trim();
        String[] split = auth.split(" ");
        if (split.length == 2) {
            String a = split[0];
            String b = split[1];
            if (pinYinSet.contains(b.toLowerCase()) && a.contains("-") && !a.endsWith("-") && !a.startsWith("-")) {
                String[] list = a.split("-");
                if (list.length == 2) {
                    if (pinYinSet.contains(list[0].toLowerCase()) && pinYinSet.contains(list[1].toLowerCase())) {
                        return b + " " + list[0] + list[1]; // Qi-Yue Chen
                    }
                }
            }
            if (pinYinSet.contains(a.toLowerCase()) && b.contains("-") && !b.endsWith("-") && !b.startsWith("-")) {
                String[] list = b.split("-");
                if (list.length == 2) {
                    if (pinYinSet.contains(list[0].toLowerCase()) && pinYinSet.contains(list[1].toLowerCase())) {
                        return a + " " + list[0] + list[1]; // Chen Qi-Yue
                    }
                }
            }
            if (pinYinSet.contains(b.toLowerCase()) && a.length() > 3 && !pinYinSet.contains(a.toLowerCase())) {
                for (int i = 2; i < a.length(); i++) {
                    String firstName = a.substring(0, i);
                    String lastName = a.substring(i);
                    if (pinYinSet.contains(firstName.toLowerCase()) && pinYinSet.contains(lastName.toLowerCase())) {
                        return b + " " + a; // QiYue Chen
                    }
                }
            }
            if (a.length() == 1 && b.length() > 1) {
                return b + " " + a; // y zhong
            }
        }
        if (split.length == 3) {
            String a = split[0];
            String b = split[1];
            String c = split[2];
            if (pinYinSet.contains(a.toLowerCase()) && pinYinSet.contains(b.toLowerCase()) && pinYinSet.contains(c.toLowerCase())) {
                return split[0] + " " + split[1] + split[2];
            }
            if (a.length() == 1 && b.length() == 1 && c.length() > 1) {
                return c + " " + a + " " + b; // y h yang
            }
        }
        return auth;
    }

    /**
     * 如果含有.edu的邮箱，则把域名提取出来，并添加到邮箱的前面，如果不含.edu的邮箱，则仅在邮箱前面加上逗号。.replace("$", "Łł")？因为$是特殊字符，需要提前作下处理，而^没有发现有此现象。
     * School of BioSciences g.shaw@unimelb.EDu.CN -> School of BioSciences [ĺunimelb.EDu.CNļ], g.shaw@unimelb.EDu.CN 如果是edu.cn或其它的含有edu的也在邮箱前面添加域名
     * School of BioSciences g.shaw@unimelb.EDu BioSciences -> School of BioSciences [ĺunimelb.EDuļ], g.shaw@unimelb.EDu, BioSciences 如果是edu的邮箱，则在邮箱前面添加域名
     * School of BioSciences g.shaw@unimelb.E2Du BioSciences -> School of BioSciences , g.shaw@unimelb.E2Du, BioSciences 如果是非edu的邮箱，则在前后加逗号
     * School of BioSciences g.shaw@unimelb.E2Du BioSciences g.shaw@unimelb.EDu -> School of BioSciences g.shaw@unimelb.E2Du BioSciences [ĺunimelb.EDuļ], g.shaw@unimelb.EDu 如果存在两个邮箱，则只关注edu的邮箱
     */
    public static String modifyEmail(String input) {
        // 在PubMed的作者单位信息中，往往会包含作者的edu邮箱，利用此邮箱可以区分作者的单位，在程序给予了提取，比如："[ĺyalE.eduļ], "，邮箱后缀加方括号，括号内以"ĺ"开头，以"ļ"结尾，方便识别。
        try {
            input = input.replace("$", "Łł");
            Pattern pattern = Pattern.compile("(\\S+)@(\\S+\\.(?:edu|eDu|edU|EDu|EdU|eDU|EDU|Edu)(?:\\.\\S+)?(?: |$))");
            Matcher matcher = pattern.matcher(input);
            StringBuffer result = new StringBuffer();
            while (matcher.find()) {
                String emailPrefix = matcher.group(1);
                String domainPart = matcher.group(2).trim();
                String replacement = "[ĺ" + domainPart + "ļ], " + emailPrefix + "@" + domainPart + ", ";
                matcher.appendReplacement(result, replacement);
            }
            if (result.length() == 0) {
                return input.replaceAll("(\\S+@\\S+\\.\\S+)", ", $1, ").replaceAll(" +", " ").replaceAll(", $", "").replaceAll("^, ", "").replace("Łł", "$").trim();
            } else {
                matcher.appendTail(result);
                if (result.length() == 0) {
                    return input.replaceAll("(\\S+@\\S+\\.\\S+)", ", $1, ").replaceAll(", $", "").replaceAll("^, ", "").replace("Łł", "$").trim();
                } else {
                    return result.toString().replaceAll(", $", "").replaceAll("^, ", "").replace("Łł", "$").trim();
                }
            }
        } catch (Exception e) {
//            System.out.println("正则出问题了：" + input);
            return input.replace("Łł", "$");
        }
    }

    public static boolean isContains(String original, Set<String> pmSetAbbUniv) {
        // 这个方法是本程序的核心，用于判断人工整理的字符串，是否在文本中出现，如果出现则给予捕获，返回true。
        for (String s : pmSetAbbUniv) {
            if (original.equals(s) || original.startsWith(s + "/") || original.startsWith(s + " ") || original.startsWith(s + "-") || original.startsWith(s + ",") ||
                    original.endsWith(" " + s) || original.endsWith("/" + s) || original.endsWith("-" + s) || original.endsWith("," + s) || original.endsWith(s + ")") ||
                    original.contains("/" + s + " ") || original.contains("-" + s + " ") || original.contains(" " + s + " ") || original.contains("(" + s + " ") || original.contains(" " + s + ")") || original.contains("," + s + " ") ||
                    original.contains(" " + s + "/") || original.contains(" " + s + "-") || original.contains(" " + s + ",") || original.contains(" " + s + ".") || original.contains("(" + s + ")") ||
                    (s.length() > 8 && (original.contains(" " + s) || original.contains(s + " ") || original.contains("/" + s) || original.contains(s + "/") || original.contains("-" + s) || original.contains(s + "-")))
                    || (s.contains(" ") && original.contains(s))) {
                return true;
            }
        }
        return false;
    }

    public static String setToStr(Set<String> set) {
        if (null != set && !set.isEmpty()) {
            StringBuilder str = new StringBuilder();
            for (String s : set) {
                if (null != s && !s.isEmpty()) {
                    str.append(s).append("; ");
                }
            }
            return str.toString().endsWith("; ") ? str.substring(0, str.length() - "; ".length()) : str.toString();
        }
        return "";
    }

    public static void addSet(String standard, Map<String, String> standardAndKeyWordMap, String original, Set<String> univSet) {
        if (!standardAndKeyWordMap.containsKey(standard)) {
            standardAndKeyWordMap.put(standard, original);
        }
        univSet.add(standardAndKeyWordMap.get(standard));
    }


    // Ru-Hong Tu; Chang-Ming Huang  英文名字中，新志贾这类属于正序，反之贾新志这类属于反序，程序默认为正序转反序，如果是反序则不用再转换了。对于正序返回true，没有一条是正序，则返回false。
    public static boolean getPiYiOrder(String piYinAuth, Set<String> pinYinSet) {
        // Ru-Hong Tu; Chang-Ming Huang  英文名字中，新志贾这类属于正序，反之贾新志这类属于反序，程序默认为正序转反序，如果是反序则不用再转换了。
        Matcher matcher = Pattern.compile("([a-zA-Z])").matcher(piYinAuth);
        if (matcher.find()) {
            String[] split = piYinAuth.toLowerCase().split(";");
            for (String auth : split) {
                String[] list = auth.replace(",", " ").trim().replace("  ", " ").split(" ");
                if (list.length == 2) {
                    String a = list[0];
                    String b = list[1];
                    if (pinYinSet.contains(a) && b.contains("-") && !b.startsWith("-") && !b.endsWith("-")) {
                        String[] end = b.split("-");
                        if (end.length == 2 && pinYinSet.contains(end[0]) && pinYinSet.contains(end[1])) {
//                            System.out.println("1 " + auth);
                            return false; // Chen, Qi-Yue
                        }
                    }
                    if (pinYinSet.contains(b) && a.contains("-") && !a.startsWith("-") && !a.endsWith("-")) {
                        String[] end = a.split("-");
                        if (end.length == 2 && pinYinSet.contains(end[0]) && pinYinSet.contains(end[1])) {
//                            System.out.println("2 " + auth);
                            return true; // Jian-Xian, Lin
                        }
                    }
                }
            }

            for (String auth : split) {
                String[] list = auth.replace("  ", " ").trim().split(",");
                if (list.length == 2) {
                    String a = list[0].replace(" ", "").trim();
                    String b = list[1].replace(" ", "").trim();
                    if (pinYinSet.contains(a) && b.length() > 3 && !pinYinSet.contains(b)) {
                        for (int i = 2; i < b.length(); i++) {
                            String firstName = b.substring(0, i);
                            String lastName = b.substring(i);
                            if (pinYinSet.contains(firstName) && pinYinSet.contains(lastName)) {
//                                System.out.println("3 " + auth);
                                return false; // Chen, QiYue
                            }
                        }
                    }
                    if (pinYinSet.contains(b) && a.length() > 3 && !pinYinSet.contains(a)) {
                        for (int i = 2; i < a.length(); i++) {
                            String firstName = a.substring(0, i);
                            String lastName = a.substring(i);
                            if (pinYinSet.contains(firstName) && pinYinSet.contains(lastName)) {
//                                System.out.println("4 " + auth);
                                return true; // JianXian, Lin
                            }
                        }
                    }
                }
            }

            for (String auth : split) {
                if (auth.lastIndexOf(" ") > 0) {
                    String a = auth.substring(0, auth.lastIndexOf(" ")).replace("-", "").replace(",", "").replace(".", "").replace(" ", "").trim();
                    String b = auth.substring(auth.lastIndexOf(" ")).replace("-", "").replace(",", "").replace(".", "").replace(" ", "").trim();
                    if (pinYinSet.contains(a) && !pinYinSet.contains(b) && b.length() > 3) {
                        // 对连在一起的字符串，判断是否是二个拼音构成，比如：ChengChang
                        for (int i = 2; i < b.length(); i++) {
                            String firstName = b.substring(0, i);
                            String lastName = b.substring(i);
                            if (pinYinSet.contains(firstName) && pinYinSet.contains(lastName)) {
//                                System.out.println("5 " + auth);
                                return false; // Chen, QiYue
                            }
                        }
                    }
                    if (pinYinSet.contains(b) && !pinYinSet.contains(a) && a.length() > 3) {
                        // 对连在一起的字符串，判断是否是二个拼音构成，比如：ChengChang
                        for (int i = 2; i < a.length(); i++) {
                            String firstName = a.substring(0, i);
                            String lastName = a.substring(i);
                            if (pinYinSet.contains(firstName) && pinYinSet.contains(lastName)) {
//                                System.out.println("6 " + auth);
                                return true; // QiYue Chen
                            }
                        }
                    }
                }
            }
        }
        return false;
    }


    public static En.UnivHosp getUnivHosp() {
        En.UnivHosp univHosp = new En.UnivHosp();
        univHosp.setSupplementarySet(PmSet.toLowerSet(PmList.getSupplementarySet()));
        univHosp.setRemoveSet(PmSet.toLowerSet(PmList.getRemoveSet()));
        univHosp.setUnivAbbSet(PmList.getUnivAbbSet());
        univHosp.setUnivNameSet(PmSet.toLowerSet(PmList.getUnivNameSet()));
        univHosp.setUnivFullSet(PmSet.toLowerSet(PmList.getUnivFullSet()));
        univHosp.setCollFullSet(PmSet.toLowerSet(PmList.getCollFullSet()));
        univHosp.setHospNameSet(PmSet.toLowerSet(PmList.getHospNameSet()));
        univHosp.setHospFullSet(PmSet.toLowerSet(PmList.getHospFullSet()));
        univHosp.setClinicSet(PmSet.toLowerSet(PmList.getClinicSet()));
        univHosp.setCancerCenterSet(PmSet.toLowerSet(PmList.getCancerCenterSet()));
        univHosp.setMedicalCentreSet(PmSet.toLowerSet(PmList.getMedicalCentreSet()));
        univHosp.setNationalSet(PmSet.toLowerSet(PmSet.getNationalSet()));
        univHosp.setSuppNatiSet(PmSet.toLowerSet(PmSet.getSuppNatiSet()));
        univHosp.setInstituteSet(PmSet.toLowerSet(PmSet.getInstituteSet()));
        univHosp.setDepartmentSet(PmSet.toLowerSet(PmSet.getDepartmentSet()));
        univHosp.setNatiNameSet(PmSet.toLowerSet(PmSet.getNatiNameSet()));
        univHosp.setCollNameSet(PmSet.toLowerSet(PmSet.getCollNameSet()));
        univHosp.setDeptNameSet(PmSet.toLowerSet(PmSet.getDeptNameSet()));
        univHosp.setInstNameSet(PmSet.toLowerSet(PmSet.getInstNameSet()));
        return univHosp;
    }


    public static Set<String> getPinYinSet() {
        Set<String> pinYinSet = new HashSet<>();
        pinYinSet.add("ai");
        pinYinSet.add("an");
        pinYinSet.add("ao");
        pinYinSet.add("ba");
        pinYinSet.add("bi");
        pinYinSet.add("bo");
        pinYinSet.add("bu");
        pinYinSet.add("ca");
        pinYinSet.add("ce");
        pinYinSet.add("ci");
        pinYinSet.add("cu");
        pinYinSet.add("da");
        pinYinSet.add("de");
        pinYinSet.add("di");
        pinYinSet.add("du");
        pinYinSet.add("en");
        pinYinSet.add("er");
        pinYinSet.add("fa");
        pinYinSet.add("fu");
        pinYinSet.add("ga");
        pinYinSet.add("ge");
        pinYinSet.add("gu");
        pinYinSet.add("ha");
        pinYinSet.add("he");
        pinYinSet.add("hu");
        pinYinSet.add("ji");
        pinYinSet.add("ju");
        pinYinSet.add("ka");
        pinYinSet.add("ke");
        pinYinSet.add("ku");
        pinYinSet.add("la");
        pinYinSet.add("le");
        pinYinSet.add("li");
        pinYinSet.add("lu");
        pinYinSet.add("lv");
        pinYinSet.add("ma");
        pinYinSet.add("me");
        pinYinSet.add("mi");
        pinYinSet.add("mo");
        pinYinSet.add("mu");
        pinYinSet.add("na");
        pinYinSet.add("ne");
        pinYinSet.add("ni");
        pinYinSet.add("nu");
        pinYinSet.add("nv");
        pinYinSet.add("ou");
        pinYinSet.add("pa");
        pinYinSet.add("pi");
        pinYinSet.add("po");
        pinYinSet.add("pu");
        pinYinSet.add("qi");
        pinYinSet.add("qu");
        pinYinSet.add("re");
        pinYinSet.add("ri");
        pinYinSet.add("ru");
        pinYinSet.add("sa");
        pinYinSet.add("se");
        pinYinSet.add("si");
        pinYinSet.add("su");
        pinYinSet.add("ta");
        pinYinSet.add("te");
        pinYinSet.add("ti");
        pinYinSet.add("tu");
        pinYinSet.add("wa");
        pinYinSet.add("wo");
        pinYinSet.add("wu");
        pinYinSet.add("xi");
        pinYinSet.add("xu");
        pinYinSet.add("ya");
        pinYinSet.add("ye");
        pinYinSet.add("yi");
        pinYinSet.add("yo");
        pinYinSet.add("yu");
        pinYinSet.add("za");
        pinYinSet.add("ze");
        pinYinSet.add("zi");
        pinYinSet.add("zu");
        pinYinSet.add("ang");
        pinYinSet.add("bai");
        pinYinSet.add("ban");
        pinYinSet.add("bao");
        pinYinSet.add("bei");
        pinYinSet.add("ben");
        pinYinSet.add("bie");
        pinYinSet.add("bin");
        pinYinSet.add("cai");
        pinYinSet.add("can");
        pinYinSet.add("cao");
        pinYinSet.add("cen");
        pinYinSet.add("cha");
        pinYinSet.add("che");
        pinYinSet.add("chi");
        pinYinSet.add("chu");
        pinYinSet.add("cou");
        pinYinSet.add("cui");
        pinYinSet.add("cun");
        pinYinSet.add("cuo");
        pinYinSet.add("dai");
        pinYinSet.add("dan");
        pinYinSet.add("dao");
        pinYinSet.add("den");
        pinYinSet.add("die");
        pinYinSet.add("diu");
        pinYinSet.add("dou");
        pinYinSet.add("dui");
        pinYinSet.add("dun");
        pinYinSet.add("duo");
        pinYinSet.add("fan");
        pinYinSet.add("fei");
        pinYinSet.add("fen");
        pinYinSet.add("fou");
        pinYinSet.add("gai");
        pinYinSet.add("gan");
        pinYinSet.add("gao");
        pinYinSet.add("gei");
        pinYinSet.add("gen");
        pinYinSet.add("gou");
        pinYinSet.add("gua");
        pinYinSet.add("gui");
        pinYinSet.add("gun");
        pinYinSet.add("guo");
        pinYinSet.add("hai");
        pinYinSet.add("han");
        pinYinSet.add("hao");
        pinYinSet.add("hei");
        pinYinSet.add("hen");
        pinYinSet.add("hou");
        pinYinSet.add("hua");
        pinYinSet.add("hui");
        pinYinSet.add("hun");
        pinYinSet.add("huo");
        pinYinSet.add("jia");
        pinYinSet.add("jie");
        pinYinSet.add("jin");
        pinYinSet.add("jiu");
        pinYinSet.add("jue");
        pinYinSet.add("jun");
        pinYinSet.add("kai");
        pinYinSet.add("kan");
        pinYinSet.add("kao");
        pinYinSet.add("ken");
        pinYinSet.add("kou");
        pinYinSet.add("kua");
        pinYinSet.add("kui");
        pinYinSet.add("kun");
        pinYinSet.add("kuo");
        pinYinSet.add("lai");
        pinYinSet.add("lan");
        pinYinSet.add("lao");
        pinYinSet.add("lei");
        pinYinSet.add("lia");
        pinYinSet.add("lie");
        pinYinSet.add("lin");
        pinYinSet.add("liu");
        pinYinSet.add("lou");
        pinYinSet.add("lun");
        pinYinSet.add("luo");
        pinYinSet.add("lve");
        pinYinSet.add("mai");
        pinYinSet.add("man");
        pinYinSet.add("mao");
        pinYinSet.add("mei");
        pinYinSet.add("men");
        pinYinSet.add("mie");
        pinYinSet.add("min");
        pinYinSet.add("miu");
        pinYinSet.add("mou");
        pinYinSet.add("nai");
        pinYinSet.add("nan");
        pinYinSet.add("nao");
        pinYinSet.add("nei");
        pinYinSet.add("nen");
        pinYinSet.add("nie");
        pinYinSet.add("nin");
        pinYinSet.add("niu");
        pinYinSet.add("nou");
        pinYinSet.add("nuo");
        pinYinSet.add("nve");
        pinYinSet.add("pai");
        pinYinSet.add("pan");
        pinYinSet.add("pao");
        pinYinSet.add("pei");
        pinYinSet.add("pen");
        pinYinSet.add("pie");
        pinYinSet.add("pin");
        pinYinSet.add("pou");
        pinYinSet.add("qia");
        pinYinSet.add("qie");
        pinYinSet.add("qin");
        pinYinSet.add("qiu");
        pinYinSet.add("que");
        pinYinSet.add("qun");
        pinYinSet.add("ran");
        pinYinSet.add("rao");
        pinYinSet.add("ren");
        pinYinSet.add("rou");
        pinYinSet.add("rua");
        pinYinSet.add("rui");
        pinYinSet.add("run");
        pinYinSet.add("ruo");
        pinYinSet.add("sai");
        pinYinSet.add("san");
        pinYinSet.add("sao");
        pinYinSet.add("sen");
        pinYinSet.add("sha");
        pinYinSet.add("she");
        pinYinSet.add("shi");
        pinYinSet.add("shu");
        pinYinSet.add("sou");
        pinYinSet.add("sui");
        pinYinSet.add("sun");
        pinYinSet.add("suo");
        pinYinSet.add("tai");
        pinYinSet.add("tan");
        pinYinSet.add("tao");
        pinYinSet.add("tie");
        pinYinSet.add("tou");
        pinYinSet.add("tui");
        pinYinSet.add("tun");
        pinYinSet.add("tuo");
        pinYinSet.add("wai");
        pinYinSet.add("wan");
        pinYinSet.add("wei");
        pinYinSet.add("wen");
        pinYinSet.add("xia");
        pinYinSet.add("xie");
        pinYinSet.add("xin");
        pinYinSet.add("xiu");
        pinYinSet.add("xue");
        pinYinSet.add("xun");
        pinYinSet.add("yan");
        pinYinSet.add("yao");
        pinYinSet.add("yin");
        pinYinSet.add("you");
        pinYinSet.add("yue");
        pinYinSet.add("yun");
        pinYinSet.add("zai");
        pinYinSet.add("zan");
        pinYinSet.add("zao");
        pinYinSet.add("zei");
        pinYinSet.add("zen");
        pinYinSet.add("zha");
        pinYinSet.add("zhe");
        pinYinSet.add("zhi");
        pinYinSet.add("zhu");
        pinYinSet.add("zou");
        pinYinSet.add("zui");
        pinYinSet.add("zun");
        pinYinSet.add("zuo");
        pinYinSet.add("bang");
        pinYinSet.add("beng");
        pinYinSet.add("bian");
        pinYinSet.add("biao");
        pinYinSet.add("bing");
        pinYinSet.add("cang");
        pinYinSet.add("ceng");
        pinYinSet.add("chai");
        pinYinSet.add("chan");
        pinYinSet.add("chao");
        pinYinSet.add("chen");
        pinYinSet.add("chou");
        pinYinSet.add("chui");
        pinYinSet.add("chun");
        pinYinSet.add("chuo");
        pinYinSet.add("cong");
        pinYinSet.add("cuan");
        pinYinSet.add("dang");
        pinYinSet.add("deng");
        pinYinSet.add("dian");
        pinYinSet.add("diao");
        pinYinSet.add("ding");
        pinYinSet.add("dong");
        pinYinSet.add("duan");
        pinYinSet.add("fang");
        pinYinSet.add("feng");
        pinYinSet.add("gang");
        pinYinSet.add("geng");
        pinYinSet.add("gong");
        pinYinSet.add("guai");
        pinYinSet.add("guan");
        pinYinSet.add("hang");
        pinYinSet.add("heng");
        pinYinSet.add("hong");
        pinYinSet.add("huai");
        pinYinSet.add("huan");
        pinYinSet.add("jian");
        pinYinSet.add("jiao");
        pinYinSet.add("jing");
        pinYinSet.add("juan");
        pinYinSet.add("kang");
        pinYinSet.add("keng");
        pinYinSet.add("kong");
        pinYinSet.add("kuai");
        pinYinSet.add("kuan");
        pinYinSet.add("lang");
        pinYinSet.add("leng");
        pinYinSet.add("lian");
        pinYinSet.add("liao");
        pinYinSet.add("ling");
        pinYinSet.add("long");
        pinYinSet.add("luan");
        pinYinSet.add("mang");
        pinYinSet.add("meng");
        pinYinSet.add("mian");
        pinYinSet.add("miao");
        pinYinSet.add("ming");
        pinYinSet.add("nang");
        pinYinSet.add("neng");
        pinYinSet.add("nian");
        pinYinSet.add("niao");
        pinYinSet.add("ning");
        pinYinSet.add("nong");
        pinYinSet.add("nuan");
        pinYinSet.add("pang");
        pinYinSet.add("peng");
        pinYinSet.add("pian");
        pinYinSet.add("piao");
        pinYinSet.add("ping");
        pinYinSet.add("qian");
        pinYinSet.add("qiao");
        pinYinSet.add("qing");
        pinYinSet.add("quan");
        pinYinSet.add("rang");
        pinYinSet.add("reng");
        pinYinSet.add("rong");
        pinYinSet.add("ruan");
        pinYinSet.add("sang");
        pinYinSet.add("seng");
        pinYinSet.add("shai");
        pinYinSet.add("shan");
        pinYinSet.add("shao");
        pinYinSet.add("shei");
        pinYinSet.add("shen");
        pinYinSet.add("shou");
        pinYinSet.add("shua");
        pinYinSet.add("shui");
        pinYinSet.add("shun");
        pinYinSet.add("shuo");
        pinYinSet.add("song");
        pinYinSet.add("suan");
        pinYinSet.add("tang");
        pinYinSet.add("teng");
        pinYinSet.add("tian");
        pinYinSet.add("tiao");
        pinYinSet.add("ting");
        pinYinSet.add("tong");
        pinYinSet.add("tuan");
        pinYinSet.add("wang");
        pinYinSet.add("weng");
        pinYinSet.add("xian");
        pinYinSet.add("xiao");
        pinYinSet.add("xing");
        pinYinSet.add("xuan");
        pinYinSet.add("yang");
        pinYinSet.add("ying");
        pinYinSet.add("yong");
        pinYinSet.add("yuan");
        pinYinSet.add("zang");
        pinYinSet.add("zeng");
        pinYinSet.add("zhai");
        pinYinSet.add("zhan");
        pinYinSet.add("zhao");
        pinYinSet.add("zhen");
        pinYinSet.add("zhou");
        pinYinSet.add("zhua");
        pinYinSet.add("zhui");
        pinYinSet.add("zhun");
        pinYinSet.add("zhuo");
        pinYinSet.add("zong");
        pinYinSet.add("zuan");
        pinYinSet.add("chang");
        pinYinSet.add("cheng");
        pinYinSet.add("chong");
        pinYinSet.add("chuai");
        pinYinSet.add("chuan");
        pinYinSet.add("guang");
        pinYinSet.add("huang");
        pinYinSet.add("jiang");
        pinYinSet.add("jiong");
        pinYinSet.add("kuang");
        pinYinSet.add("liang");
        pinYinSet.add("niang");
        pinYinSet.add("qiang");
        pinYinSet.add("qiong");
        pinYinSet.add("shang");
        pinYinSet.add("sheng");
        pinYinSet.add("shuai");
        pinYinSet.add("shuan");
        pinYinSet.add("xiang");
        pinYinSet.add("xiong");
        pinYinSet.add("zhang");
        pinYinSet.add("zheng");
        pinYinSet.add("zhong");
        pinYinSet.add("zhuai");
        pinYinSet.add("zhuan");
        pinYinSet.add("chuang");
        pinYinSet.add("shuang");
        pinYinSet.add("zhuang");
        pinYinSet.add("ou-yang");
        pinYinSet.add("ouyang");
        return pinYinSet;
    }


}
